#ifndef SCOPE_H
#define SCOPE_H

#include "types.h"

/*
 These will likely need massive refactoring for performance
  - Particularly if we're going to compile
 Immutable bindings makes life slightly easier, though :)
  - Multiple defs might not be happy with this
  - What do we do about shadowing? Do we even allow it?
*/

scope_t *make_scope(scope_t *parent, generic_list_t *name_list, generic_list_t *value_list, name_t *tail);
void bind(scope_t *scope, name_t *name, value_t *value);
value_t *lookup_flat_symbol(scope_t *scope, name_t *name, handler_t *handler);
value_t *lookup(scope_t *scope, name_t *name, int nested, handler_t *handler);

#endif // SCOPE_H
